<template>
	<view @tap="toCheck">
		<slot></slot>
	</view>
</template>

<script>
	export default {
		name: "checkLogin",
		props: {
			url: {
				type: String ,
				default: ""
			},
			needVerify:{ //是否需要实名认证
				default : false 
			}
		},
		
		data() {
			return {
				
			};
		},
		
		methods:{
			
			toCheck:function(e){
				this.kit.get("/api/member/checkLogin",{},res => {
					if(res.isLogin){
						if(!this.needVerify || res.isVerify){
							uni.navigateTo({
								url: this.url
							})
							return ;
						}
						uni.setStorageSync("beforeLoginUrl" , this.url);
						uni.navigateTo({
							url:"/pages/confirmVerify/confirmVerify"
						});
						return ;
					}
					uni.setStorageSync("beforeLoginUrl" , this.url);
					uni.navigateTo({
						url:"/pages/login/login?needVerify=" + (this.needVerify ? 'yes' : 'no')
					});
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
		width: 100%;
		height: 100%;
	}
.page{
	background-color: $main;
	width: 100%;
	height: 100%;
}

.sImg{
	width: 240upx;
}

.fz30{
	letter-spacing: 10px;
}

.grayCirle{
	background-color: #ea5e81;
	width: 100px;
	height: 100px;
	border-radius: 100%;
}

.grayCirle.left{
	position: fixed;
	left: -14%;
	bottom: 200upx;
}

.grayCirle.right{
	position: fixed;
	right: -14%;
	top: 20%;
}

.gradualBg,.btn{
	padding: 18upx 70upx;
	font-size: 30upx;
}
</style>
